Skip to content

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Sep 8, 2025

Description

Fixes #9477

This PR add a check for userdata linked with templates not owned by the account during account cleanup

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.24%. Comparing base (750290b) to head (f384872).

Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #11595   +/-   ##
=========================================
  Coverage     16.23%   16.24%           
- Complexity    13378    13386    +8     
=========================================
  Files          5657     5657           
  Lines        498932   498967   +35     
  Branches      60552    60554    +2     
=========================================
+ Hits          81016    81063   +47     
+ Misses       408882   408869   -13     
- Partials       9034     9035    +1     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.10% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shwstppr shwstppr force-pushed the acc-userdata-unlink branch from 7acde42 to 3a31c16 Compare September 9, 2025 10:17
@shwstppr
Copy link
Contributor Author

shwstppr commented Sep 9, 2025

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14922

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwstppr I believe this fix will not effect the VMs that are already created using the template which previously linked to the userdata as we are saving the actual userdata in user_vm table. am I right ?

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr
Copy link
Contributor Author

@harikrishna-patnala I'm not sure if we save all user data in user_vm table.
This change is draft as I've not verified myself yet. It may not be needed now that we don't completely remove the userdata entry and just mark it removed

@shwstppr I believe this fix will not effect the VMs that are already created using the template which previously linked to the userdata as we are saving the actual userdata in user_vm table. am I right ?

@shwstppr shwstppr force-pushed the acc-userdata-unlink branch from 3a31c16 to 869ffad Compare November 18, 2025 14:48
@shwstppr shwstppr changed the base branch from main to 4.20 November 18, 2025 14:48
@shwstppr shwstppr changed the title server,engine-schema: unlink userdata during acount cleanup server,engine-schema: add check for account userdata cleanup Nov 18, 2025
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 15799

@shwstppr
Copy link
Contributor Author

shwstppr commented Jan 7, 2026

@harikrishna-patnala #9477 was still valid so I updated changes here to prevent account deletion when a userdata owned by the account is linked templates not owned by the account

@apache apache deleted a comment from blueorangutan Jan 7, 2026
@shwstppr
Copy link
Contributor Author

shwstppr commented Jan 7, 2026

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@shwstppr shwstppr modified the milestones: 4.22.1, 4.20.3 Jan 7, 2026
@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16287

}

@Override
public List<Long> listByUserdataIdsNotAccount(List<Long> userdataIds, long accountId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public List<Long> listByUserdataIdsNotAccount(List<Long> userdataIds, long accountId) {
public List<Long> listByUserdataIdsNotInAccount(List<Long> userdataIds, long accountId) {

or listByUserdataIdsNotBelongToAccount

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit, clgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleted userdata owned by a deleted account remains linked with the template

4 participants